PROJECT = ~/text-categorization-som/text
PROFILER  = time python
LEARN = ./learn.py
CLASSIFY = ./classify.py
PLOT = ./plot.py
PLOTMAP = ./plotmap.py

DOC_PRECLASS    = $(PROJECT)/data/document_encoding/preclass.txt
DOC_COLORMAP    = $(PROJECT)/data/document_encoding/colormap.txt
DOC_TDATA_LEARN = $(PROJECT)/data/document_encoding/training_vectors.txt
DOC_TDATA_CLASS = $(PROJECT)/data/document_encoding/data_class.txt

# dimension of input space is 3 times vocab size (as our inputs are trigrams)
DOC_DIM         = 100
DOC_TS_SIZE     = 11314
#DOC_TS_SIZE     = 5000
# we need a mesh that can hold %75 of vocabulary 
#DOC_SIZE_X      = 500
DOC_SIZE_X      = 100
DOC_SIZE_Y      = $(DOC_SIZE_X)
DOC_SOM_INI     = DOC_som_ini.dat
DOC_SOM_FIN     = DOC_som_fin.dat
DOC_CLASS_DATA  = DOC_class.dat
DOC_SHOW_PROG   = 50
DOC_LEARN_OUT   = DOC_learn.out
DOC_CLASS_OUT   = DOC_class.out
DOC_MIN_W       = 0
DOC_MAX_W       = 1
DOC_EPOCHS      = 1
DOC_DEBUG       = 1
DOC_PLOTMAP_OUT = DOC_plotmap.png

all: learn_doc plotmap_doc

learn_doc: $(LEARN)
	$(PROFILER) $(LEARN) $(DOC_DIM) $(DOC_TS_SIZE) $(DOC_TDATA_LEARN) $(DOC_SIZE_X) $(DOC_SIZE_Y) $(DOC_MIN_W) $(DOC_MAX_W) $(DOC_SOM_INI) $(DOC_SOM_FIN) $(DOC_EPOCHS) $(DOC_DEBUG) $(DOC_SHOW_PROG) > $(DOC_LEARN_OUT) 2>&1

plotmap_doc: $(PLOTMAP)
	$(PROFILER) $(PLOTMAP) $(DOC_DIM) $(DOC_TS_SIZE) $(DOC_TDATA_LEARN) $(DOC_SIZE_X) $(DOC_SIZE_Y) $(DOC_SOM_FIN) $(DOC_PRECLASS) $(DOC_COLORMAP) $(DOC_PLOTMAP_OUT)

clean:
	rm -fr *.pyc
	rm -f $(DOC_SOM_INI) $(DOC_SOM_FIN) $(DOC_LEARN_OUT) $(DOC_CLASS_OUT) $(DOC_CLASS_DATA) $(DOC_PLOTMAP_OUT)
